﻿#region Header

/*
Remote views based on linq
By

Pascal Hauser 
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

and

Raphael Gfeller
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

*/

#endregion

#region Usings

using System;
using System.Collections.Generic;

#endregion

namespace Sebastof.Services.Interfaces {
	/// <summary>
	/// defines how data of object are stored and retrieved
	/// </summary>
	public interface IDataHandlingStrategy {
		#region Public Methods

		/// <summary>
		/// Gets the value with the given key for the given object
		/// </summary>
		/// <param name="key"></param>
		/// <param name="forObject"></param>
		/// <returns></returns>
		object GetValue(string key, object forObject);

		/// <summary>
		/// gets the value with the given key as the given type
		/// </summary>
		/// <typeparam name="T"></typeparam>
		/// <param name="key"></param>
		/// <param name="forObject"></param>
		/// <returns></returns>
		T GetValue<T>(string key, object forObject);

		/// <summary>
		/// Get all values that are hold by the strategy for the given object
		/// </summary>
		/// <returns></returns>
		KeyValuePair<Object, KeyValuePair<string, object>[]>[] GetValues();

		/// <summary>
		/// sets the value for the given object for the given key
		/// </summary>
		/// <param name="key"></param>
		/// <param name="value"></param>
		/// <param name="forObject"></param>
		void SetValue(string key, object value, object forObject);

		/// <summary>
		/// returns if the given value is different as the stored one
		/// </summary>
		/// <param name="key"></param>
		/// <param name="value"></param>
		/// <param name="forObject"></param>
		/// <returns></returns>
		bool IsDifferent(string key, object value, object forObject);

		#endregion
	}
}